<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/6
 * Time: 14:06
 */

namespace app\admin\controller\business;


use app\common\controller\AdminController;
use think\app;
use think\facade\Session;
use think\facade\View;

class Order extends AdminController
{
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->model = app('app\common\model\mall\Order');

    }

    /**
     * 积分订单列表
     */
    public function get_where($arr = []){
        $admin = Session::get('admin');
        $array[] = ['store_id','=',$admin['store_id']];
        $array[] = ['status','<>',7];
        if(isset($arr['order_sn']) && !empty($arr['order_sn'])){
            $array[] = ['order_sn','like','%'.$arr['order_sn'].'%'];
        }
//dd($array);
        return $array;
    }

    /**
     * 详情
     */
    public function get_edit(){
        $id = $this->request->param('id');
        $row = $this->model->with(['Goods','User'])->find($id);

        View::assign('row', $row);
        return View::fetch('edit');
    }
    /**
     * 关联模型
     */
    public function get_with(){
        return ['Goods','User'];
    }
}